#include <cstdio>

int main() {
    int n;
    scanf("%d", &n);
    int counts[1005] = {0};

    // 统计每个元素比多少个其他元素大
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            int val;
            scanf("%d", &val);
            if (i != j && val == 1) {
                counts[i]++;
            }
        }
    }

    // 输出结果：个数+1 即为排列值
    for (int i = 0; i < n; ++i) {
        printf("%d ", counts[i] + 1);
    }
    return 0;
}